package com.iweb.controller;

import com.iweb.common.result.ResultEntity;
import com.iweb.model.Channel;
import com.iweb.service.ChannelService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 频道 前端控制器
 * </p>
 *
 * @author jack
 * @since 2020-05-15
 */
@RestController
@RequestMapping("/channel")
public class ChannelController {

    @Autowired
    private ChannelService channelService;

    @ApiOperation("查询所有频道信息")
    @GetMapping
    public ResultEntity<List<Channel>> findAllChannel() {
        List<Channel> list = channelService.list();
        return ResultEntity.SUCCESS(list);
    }

}

